#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
	int n = 0;
	scanf("%d", &n);
	int i = 0; int j = 0; int sum1 = 1, sum2 = 0;
	for (i = 1; i <= n; i++)
	{
		for (j = 1; j <= i; j++)
		{
			sum1 *= j;
		}
		sum2 += sum1;
		sum1 = 1;
	}
	printf("%d\n", sum2);


}